import cn from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import s from './style.module.css';

function NodeInfo({ className, title, num, tag, type }) {
	return (
		<div className={cn(className, s.nodeInfo, s[type])}>
			<div className={s.title}>{title}</div>
			<div className={s.num}>{num || 0}ms</div>
			<div className={s.tagContainer}>
				<div className={s.tag}>{tag}</div>
			</div>
		</div>
	);
}

NodeInfo.propTypes = {
	className: PropTypes.string,
	title: PropTypes.string,
	num: PropTypes.number,
	tag: PropTypes.string,
	type: PropTypes.string,
};
NodeInfo.defaultProps = {
	className: '',
};

export default NodeInfo;
